/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2010.

	This file is part of the Maxsi Library.

	Maxsi Library is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi Library is distributed in the hope that it will be useful, but
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
	or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
	License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Library. If not, see <http://www.gnu.org/licenses/>.

	Maxsi Library
	A powerful Cross-Platform C++ General Purpose Library that allows you to
	efficiently create high-performance and reliable applications.

	MaxsiSort.h
	Useful sorting functions.

******************************************************************************/

#ifndef MaxsiSort_H
#define MaxsiSort_H

BeginMaxsiNamespace

//=============================================================================
//	These should expand to the most efficient algorithms implemented.
//=============================================================================
#define Maxsi__AddStringToSortedStringList AddStringToSortedStringListIncludedStrCmp
#define Maxsi__SortStringListI SortStringListIMerge	

#ifdef Maxsi_Enable_Non_Namespaced_Macros

	#define AddStringToSortedStringListASCII Maxsi__AddStringToSortedStringListASCII
	#define SortStringListI Maxsi__SortStringListI

#endif

//=============================================================================
//	Sort an unsorted string list without regard to case - System Locale.
//=============================================================================
MAXSI_LINKCPP void SortStringListISelection(char** StringList, size_t N);
MAXSI_LINKCPP void SortStringListIInsertion(char** StringList, size_t N);
MAXSI_LINKCPP void SortStringListIMerge(char** StringList, size_t N);

//=============================================================================
//	Sort an unsorted string list without regard to case - Wide Characters.
//=============================================================================
MAXSI_LINKCPP void SortStringListISelection(wchar_t** StringList, size_t N);
MAXSI_LINKCPP void SortStringListIInsertion(wchar_t** StringList, size_t N);
MAXSI_LINKCPP void SortStringListIMerge(wchar_t** StringList, size_t N);

//=============================================================================
//	Add a string to a sorted string list - System Locale.
//=============================================================================
MAXSI_LINKCPP size_t AddStringToSortedStringListHalves(char** StringList, size_t N);
MAXSI_LINKCPP size_t AddStringToSortedStringListProbabillityGuess(char** StringList, size_t N);
MAXSI_LINKCPP size_t AddStringToSortedStringListIncludedStrCmp(char** StringList, size_t N);

EndMaxsiNamespace

#endif
